Skip to content

refactor(@angular/build): use new Angular SSR API #28283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Aug 27, 2024

This commit introduces several key updates:

  • Updates Vite middleware to utilize the new SSR API.
  • Refactors prerendering, app-shell, and route extraction to align with the new rendering API.
  • Generates manifest files required by the new SSR API.

Note: This is primarily a refactor; new features and improvements will be implemented in future updates.

} = await loadEsmModuleFromMemory('./main.server.mjs');
const angularServerApp = getOrCreateAngularServerApp();
const response = await angularServerApp.render(
new Request(new URL(url, 'http://local-angular-prerender'), {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: http://local-angular-prerender is only temporary

@alan-agius4 alan-agius4 force-pushed the wireup-ssr branch 3 times, most recently from 07de060 to 4046058 Compare August 29, 2024 11:37
@alan-agius4 alan-agius4 marked this pull request as ready for review August 29, 2024 11:47
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 29, 2024
@alan-agius4 alan-agius4 requested a review from clydin August 29, 2024 12:01
return response?.text();
})()
.then((content) => {
if (typeof content !== 'string') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does undefined here mean there was an error or that the URL wasn't supported?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supported.

This commit introduces several key updates:
- Updates Vite middleware to utilize the new SSR API.
- Refactors prerendering, app-shell, and route extraction to align with the new rendering API.
- Generates manifest files required by the new SSR API.

**Note:** This is primarily a refactor; new features and improvements will be implemented in future updates.
…gularServerApp`

This change is necessary to prevent NgModule-based rendering from failing with JIT in development mode.
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 4, 2024
@alan-agius4 alan-agius4 merged commit 8419f7f into angular:main Sep 4, 2024
31 checks passed
@alan-agius4 alan-agius4 deleted the wireup-ssr branch September 4, 2024 19:15
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: @angular/build area: @angular/ssr target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants